<?php

//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() - 3600));


?>

<script src="system.js"></script>

<script language="javascript" type="text/javascript">

					
function submitbutton(pressbutton) 
{
	//var form = document.adminForm;

	switch( pressbutton )
	{
		
		case	"send":
		{
			
			var oObject = {} ;
				
			oObject["email"] = getInputValueElementId ("email" );
			oObject["password"] = getInputValueElementId( "password" );

			oObject["component"] = "authentication";
			oObject["controller"] = "user";
			oObject["task"] = "create";
			
			
			var jsonVales	=	convertToJSON(oObject);
			
			parameters	=	'parameters='+encodeURIComponent(
									convertToStringJSON(jsonVales));
			
			var method='POST';
				
				
			httpRequest ( method,
							url_API,
							parameters,
							'retornCreateUser');
					
				return false;
			
			
		}break;
		default:
		{
			
		}
	}	
	
}

function retornCreateUser( jsonObj){
	
	if( jsonObj.status == 1){
		
		//if(jsonObj.notification == 1)
		alert( jsonObj.data );
		window.location.href='home_authenticated.php';
		//else
		//	alert( "data: "+jsonObj.data );
			
	}else{
		alert( "Alerta: "+ jsonObj.data );
	}
	
}

   	
</script>

</script>


<div id="text-result">Create new user</div>
 
<form class="cmxform" action="#" method="GET">
	<input type="hidden" name="parameters" id="parameters" value=''>	

	<div id="label">e-mail</div> <div id="field"><input type="text" id="email" name="email"/></div>
	<div id="label">senha</div> <div id="field"><input type="password" id="password" name="password"/></div>
	
	<input type="button" name="enviar" value="Create" onclick="javascript:submitbutton('send');"/>
	
</form>


<a href="index.php">Login</a>



